feat(ui,sdk,shared): add UI test coverage and dual ESM+CJS builds - #19
Merged
Mona-i merged 3 commits intoSep 10, 2026
Merged
Conversation
Issue lumio-network#8 — expand @lumio/ui test coverage: - Add Card, CardTitle, CardBody render tests (children + className merge + ref) - Add Input tests: default type=text, placeholder, disabled, className merge - Add Button size variants (sm, md, lg) and secondary/ghost variant tests - Add all Badge variants: neutral, lumen, coral, sky (teal already covered) - 27 tests total, all passing (up from 6) Issue lumio-network#9 — ship dual ESM + CJS builds for all three packages: - Add tsconfig.esm.json per package (module: ESNext, moduleResolution: Bundler, outDir: dist/esm) - Update tsconfig.json per package to output CJS into dist/cjs (was dist/) - Update build script in each package.json: tsc -p tsconfig.json && tsc -p tsconfig.esm.json - Update package.json exports with import/require/types conditions for . entry - @lumio/ui also exposes ./tailwind-preset with both import and require conditions - main points to dist/cjs/index.js; module field points to dist/esm/index.js
The CI typecheck was failing because @lumio/sdk's tsconfig.json used moduleResolution: Node (inherited from tsconfig.base.json), which cannot resolve @lumio/shared when its package.json exports map only exposes import/require conditions — TypeScript 5 finds the ESM types via the exports map but rejects them under Node resolution. Fix: set module: Node16 + moduleResolution: Node16 in each package's tsconfig.json (CJS build). Node16 resolution correctly reads the exports map and picks the require condition, resolving to dist/cjs/. The tsconfig.esm.json files keep module: ESNext + moduleResolution: Bundler. Affected: packages/sdk, packages/shared, packages/ui
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
closes #8
closes #9
This PR implements both open issues in a single cohesive change.
Issue #8 — Expand
@lumio/uitest coverageFile changed:
packages/ui/src/ui.test.tsxclassName, forwardsref(Card)typeto"text", forwardsplaceholder, forwardsdisabled, mergesclassNamesecondaryandghostvariant class assertions;sm,md(default),lgsize class assertionsneutral(default),lumen,teal(pre-existing),coral,skyResult: 27 tests, all passing (up from 6).
Issue #9 — Dual ESM + CJS builds for all three packages
Strategy: two
tscinvocations per package — no new runtime dependencies needed.@lumio/shareddist/cjs/dist/esm/@lumio/sdkdist/cjs/dist/esm/@lumio/uidist/cjs/dist/esm/Per-package changes:
tsconfig.json—module: Node16+moduleResolution: Node16,outDir: dist/cjstsconfig.esm.json(new) —module: ESNext,moduleResolution: Bundler,outDir: dist/esmpackage.json— build script runs both configs;exportsmap updated withimport/require/typesconditions;main->dist/cjs/index.js,module->dist/esm/index.js@lumio/ui./tailwind-presetsub-path also gets bothimportandrequireconditionsValidation
pnpm lintgreenpnpm typecheckgreenpnpm buildgreen (all 3 packages, both CJS + ESM)pnpm testgreen (55 tests: 27 UI + 25 shared + 3 sdk)